import java.awt.*;

public class Room {
	Toolkit zestaw = Toolkit.getDefaultToolkit();
    Dimension monitor = zestaw.getScreenSize();
	
	public static int worldWidth = 20;
	public static int worldHeight = 15;
	public static int blockSize = 38;
	
	public Block[][] block;
	
	public Room() {
		define();		
	}
	public void define() {
		block = new Block[worldHeight][worldWidth];
		for (int y=0; y<block.length; y++) {
			for (int x=0; x<block[0].length; x++) {
				//block[y][x] = new Block((Screen.myWidth/2) - (worldWidth*blockSize)/2 + (x * blockSize), (Screen.myHeight/2) - (worldHeight*blockSize)/2 + (y * blockSize), blockSize, blockSize, Value.groundGrass, Value.airAir);
				block[y][x] = new Block((x * blockSize),(y * blockSize), blockSize, blockSize, Value.groundGrass0, Value.airAir);
			}
		}
	}
	
	public void physic() {
		for (int y = 0; y < block.length; y++) {
			for (int x = 0; x < block.length; x++) {
				block[y][x].physic();
			}
		}
	}

	public void draw(Graphics g) {
		for (int y=0; y<block.length; y++) {
			for (int x=0; x<block[0].length; x++) {
				block[y][x].draw(g);
			}
		}	
		
		for (int y=0; y<block.length; y++) {
			for (int x=0; x<block[0].length; x++) {
				block[y][x].fight(g);
			}
		}	
	}
}
